import { createStore } from 'vuex'
import login from './login/login'
import system from './main/system/system'
import type { IRootState } from './types'

const store = createStore<IRootState>({
  state: {
    name: 'webicome',
    age: 25
  },
  getters: {},
  mutations: {},
  actions: {},
  modules: {
    login,
    system
  }
})

export function setupStore() {
  store.dispatch('login/loadLocalLogin')
}
setupStore()
export default store
